import request from '@/utils/request'

export default {
    // 分页条件查询标签列表
    getList(query, current = 1, size = 20) {
        return request({ // Promise
            url: `/article/label/search`,
            method: 'post',
            data: {...query, current, size }

        })
    },
    //查询正常状态的分类
    getNormalList() {
        return request({ // Promise
            url: `/article/category/list`,
            method: 'get',

        })
    },
    //新增标签
    add(data) {
        return request({ // Promise
            url: `/article/label`,
            method: 'post',
            data
        })
    },
    getById(id) {
        return request({
            url: `/article/label/${id}`,
            method: 'get'
        })
    },
    // 提交
    update(data) {
        return request({
            url: `/article/label/`,
            method: 'put',
            data
        })
    },
    //删除
    deleteById(id) {
        return request({
            url: `/article/label/${id}`,
            method: 'delete'
        })
    },

}